import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsArray, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';

// 查询公司列表
export class FindCompanyDto {
  @ApiProperty({ default: 1, description: '当前页' })
  @Type(() => Number)
  @IsNumber()
  page: number = 1;

  @ApiProperty({ default: 10, description: '查询条数' })
  @Type(() => Number)
  @IsNumber()
  size: number = 10;

  @ApiProperty({ description: '名称' })
  @IsOptional()
  @IsString()
  name?: string;

  @ApiProperty({ description: '行业' })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  jobFairsId?: number;
}

// 更新公司基本信息
export class UpdateCompanyBaseInfoDto {
  @ApiProperty({ description: 'LOGO' })
  @IsNotEmpty()
  @IsString()
  logo: string;

  @ApiProperty({ description: '公司简称' })
  @IsNotEmpty()
  @IsString()
  name: string;

  @ApiProperty({ description: '公司全称' })
  @IsNotEmpty()
  @IsString()
  fullName: string;

  @ApiProperty({ description: '行业ID' })
  @IsNotEmpty()
  @IsNumber()
  industryId: number;

  @ApiProperty({ description: '公司性质' })
  @IsNotEmpty()
  @IsString()
  nature: string;

  @ApiProperty({ description: '公司规模' })
  @IsNotEmpty()
  @IsString()
  scale: string;
}

// 更新公司工作时间
export class UpdateCompanyWorkTimeDto {
  @ApiProperty({ description: '上下班时间' })
  @IsNotEmpty()
  @IsString()
  workTime: string;

  @ApiProperty({ description: '周末' })
  @IsNotEmpty()
  @IsString()
  weekend: string;

  @ApiProperty({ description: '加班情况' })
  @IsNotEmpty()
  @IsString()
  workOvertime: string;
}

// 更新公司福利
export class UpdateCompanyWelfareDto {
  @ApiProperty({ description: '福利' })
  @IsNotEmpty()
  @IsString()
  welfare: string;
}

// 更新公司地址
export class UpdateCompanyAddressDto {
  @ApiProperty({ description: '地址' })
  @IsNotEmpty()
  @IsString()
  address: string;
}

// 更新公司简介
export class UpdateCompanyIntroduceDto {
  @ApiProperty({ description: '简介' })
  @IsNotEmpty()
  @IsString()
  introduce: string;
}

// 创建图片
export class CreatePhotoDto {
  @ApiProperty({ description: '公司ID' })
  @IsNumber()
  company_id: number;

  @ApiProperty({ description: '图片地址' })
  @IsString()
  url: string;
}

export class UpdateCompanyDto {
  @ApiProperty({ description: 'LOGO' })
  @IsOptional()
  @IsString()
  logo?: string;

  @ApiProperty({ description: '公司简称' })
  @IsNotEmpty()
  @IsString()
  name: string;

  @ApiProperty({ description: '公司全称' })
  @IsNotEmpty()
  @IsString()
  fullName: string;

  @ApiProperty({ description: '行业ID' })
  @IsNotEmpty()
  @IsNumber()
  industryId: number;

  @ApiProperty({ description: '公司性质' })
  @IsNotEmpty()
  @IsString()
  nature: string;

  @ApiProperty({ description: '公司规模' })
  @IsNotEmpty()
  @IsString()
  scale: string;

  @ApiProperty({ description: '上下班时间' })
  @IsNotEmpty()
  @IsString()
  workTime: string;

  @ApiProperty({ description: '周末' })
  @IsNotEmpty()
  @IsString()
  weekend: string;

  @ApiProperty({ description: '加班情况' })
  @IsNotEmpty()
  @IsString()
  workOvertime: string;

  @ApiProperty({ description: '福利' })
  @IsNotEmpty()
  @IsString()
  welfare: string;

  @ApiProperty({ description: '地址' })
  @IsNotEmpty()
  @IsString()
  address: string;

  @ApiProperty({ description: '官网链接' })
  @IsNotEmpty()
  @IsString()
  link: string;

  @ApiProperty({ description: '简介' })
  @IsNotEmpty()
  @IsString()
  introduce: string;
}
